<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>酒店页面</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/js/bootstrap/css/bootstrap.min.css">
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="js/plugins/jquery-form/jquery.form.js"></script>
    <script src="/js/bootstrap/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="js/plugins/dialog2/dialog.css">
    <script src="js/plugins/dialog2/dialog.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css" >
    <link rel="stylesheet" href="/css/reset.css" >
    <link rel="stylesheet" href="/css/login.css" >
    <link rel="stylesheet" href="/css/travel.css"/>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <script src="js/plugins/My97DatePicker/WdatePicker.js"></script>
    <!--<link rel="stylesheet" href="/js/plugins/dialog2/css/dialog.css">
    <script src="/js/plugins/dialog2/js/dialog.min.js"></script>-->

</head>
<body>
<div class="nav-search">
    <a href="/index.html">
        <span>
        <a href="/index.html"><h3><</h3></a>
        </span>
    </a>
</div>
<div>
    <script>
        $(function () {
            //日历插件
            $("#hoteForm input[name=checkintime]").click(function () {
                WdatePicker({
                    /*readOnly: true, *///只读
                    minDate: new Date()//入住时间最少今天
                });
            });
            $("#hoteForm input[name=checkouttime]").click(function () {
                WdatePicker({
                    /*readOnly: true, *///只读
                    minDate:'%y-%M-{%d+1}'//只能选择当天后一天的数据
                });
            });
        })
    </script>
    <form class="form-signin" id="hoteForm" method="post" action="/hotelDetail/getHotelandInsertClient" >
        <input type="text"  name="city" class="form-control badge-pill" placeholder="请输入城市:如武汉"  >
        <input type="text"  name="checkintime" value="" class="form-control badge-pill" placeholder="入住时间"  >
        <input type="text"  name="checkouttime" value="" class="form-control badge-pill" placeholder="离店时间"  >
        <button id="hotelBtn" class="btn btn-lg badge-pill" type="button" >搜索</button>
    </form>
    <!--酒店列表-->
    <div class="container" style="" id="container111111111">
        <div id="allTravels">
            <h5>酒店列表</h5>
            <div render-loop="list">
                <div class="row detail">
                    <div class="col">
                        <a href="hotelintroduce.html?id=" render-fun="setHref" render-key="list.id">
                            <h4 render-html="list.title"></h4>
                        </a>
                        <p>
                            <a href="hotelintroduce.html?id=" render-fun="setHref" render-key="list.id">
                                <span >地址:</span> </a>
                            <span class="addr" render-html="list.site"></span>

                        </p>
                        <p>
                            <a href="hotelintroduce.html?id=" render-fun="setHref" render-key="list.id">
                                <span >最低价:</span> </a>
                        <span class="addr" render-html="list.baseprice"></span>

                        </p>
                        <p>
                            <i class="fa fa-eye fa-fw"></i><!--浏览量-->
                            <span render-html="list.pageview"></span>
                            <i class="fa fa-commenting fa-fw"></i>
                            <span>0</span>
                        </p>
                    </div>
                    <div class="col bigimg">
                        <a href="hotelintroduce.html?id=" render-fun="setHref" render-key="list.id" >
                            <img render-src="list.hotelimage"/>
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!--酒店推荐-->
    <div class="container" style="" >
        <div id="Recommendedhotel">
            <h5>推荐酒店</h5>
            <div render-loop="list">
                <div class="row detail">
                    <div class="col">
                        <a href="hotelintroduce.html?id=" render-fun="setHref" render-key="list.id">
                            <h4 render-html="list.title"></h4>
                        </a>
                        <p>
                            <a href="hotelintroduce.html?id=" render-fun="setHref" render-key="list.id">
                                <span >地址:</span> </a>
                            <span class="addr" render-html="list.site"></span>

                        </p>
                        <p>
                            <a href="hotelintroduce.html?id=" render-fun="setHref" render-key="list.id">
                                <span >最低价:</span> </a>
                            <span class="addr" render-html="list.baseprice"></span>

                        </p>
                        <p>
                            <i class="fa fa-eye fa-fw"></i><!--浏览量-->
                            <span render-html="list.pageview"></span>
                            <i class="fa fa-commenting fa-fw"></i>
                            <span>0</span>
                        </p>
                    </div>
                    <div class="col bigimg">
                        <a href="hotelintroduce.html?id=" render-fun="setHref" render-key="list.id">
                            <img render-src="list.hotelimage">
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
        $(function () {
            //推荐酒店
            $.get("/hotelDetail/"+1+"/stateHotel",function (data) {
                $("#Recommendedhotel").renderValues({list:data},{
                    setHref:function (item,value) {
                        $(item).attr("href",$(item).attr("href")+value);
                    }
                });
            })


            var qo = $("#allTravels").remove();

                $("#hotelBtn").click(function () {
                    //删除推荐的
                    $("#Recommendedhotel").remove();
                    $("#hoteForm").ajaxSubmit(function (data) {
                        if (data) {
                            $("#container111111111").append(qo);
                            $("#allTravels").renderValues({list:data},{
                                setHref:function (item,value) {
                                    $(item).attr("href",$(item).attr("href")+value);
                                }
                            })
                        }
                    })
                })



          /*  document.onkeydown = function(e){
                var ev = document.all ? window.event : e;
                if(ev.keyCode==13) {// 如（ev.ctrlKey && ev.keyCode==13）为ctrl+Center 触发
                    $("#hotelBtn").click();
                }
            }*/




        })
    </script>
    
</div>
</body>
</html>